﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddVBook.ascx.vb" Inherits="WebForm_AddVBook" %>
<%@ Register Src="~/WebForm/CommonControl/CalendarTextBox.ascx" TagName="CalendarTextBox"
    TagPrefix="My" %>
<%@ Reference Control="~/WebForm/CommonControl/CalendarTextBox.ascx" %>
<My:MyFormView ID="fv" runat="server" DataKeyNames="ID">
    <InsertItemTemplate>
        <table>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVolunteerName" runat="server" meta:resourcekey="lblVolunteerName"></asp:Label>
                </td>
                <td align="left">
                    <asp:Label ID="lblVolunteerNameText" runat="server" Text='<%# Bind("VolunteerName") %>'></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVBookID" runat="server" meta:resourcekey="lblVBookID"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSerialNumber"
                        Display="None" meta:resourcekey="rfvSerialNumber" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
                <td align="left">
                    <asp:DropDownList ID="ddlCountyID" runat="server">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlSerialGroup" runat="server">
                    </asp:DropDownList>
                    <%--<asp:CompareValidator ID="vadSerialNumber" runat="server" ControlToValidate="txtSerialNumber" ValueToCompare="000000" Operator="GreaterThanEqual" Type="String" Display="None" meta:resourcekey="rfvSerialNumber"></asp:CompareValidator>--%>
                   <%-- <My:StringLengthValidator ID="vadSerialNumber" ControlToValidate="txtSerialNumber"
                        runat="server" Length="10" Display="None" meta:resourcekey="rfvSerialNumber2"
                        ValidationGroup="vInsert" />--%>
                    <asp:Label ID="lblSerialGroup" runat="server" meta:resourcekey="lblSerialGroup"></asp:Label>
                    <asp:TextBox ID="txtSerialNumber" runat="server" MaxLength="10" Text='<%# Bind("SerialNumber") %>'></asp:TextBox>
                    <asp:Label ID="lblSerialNumber" runat="server" meta:resourcekey="lblSerialNumber"></asp:Label></td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblStatePaperID" runat="server" meta:resourcekey="lblStatePaperID"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtStatePaperID" runat="server" MaxLength="10" Text='<%# Bind("StatePaperID") %>'></asp:TextBox>
                    <%--<asp:RequiredFieldValidator ID="vadStatePaperID1" runat="server" ControlToValidate="txtStatePaperID"
                        Display="None" meta:resourcekey="vadStatePaperID" ValidationGroup="vInsert" Enabled="false"></asp:RequiredFieldValidator>--%>
                    <%--                    <My:StringLengthValidator ID="vadStatePaperID2" ControlToValidate="txtStatePaperID"
                        runat="server" Length="10" Display="None" meta:resourcekey="vadStatePaperID"
                        ValidationGroup="vInsert" Enabled="false" />--%></td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblIssueDate" runat="server" meta:resourcekey="lblIssueDate"></asp:Label>
                    <%--                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtIssueDate"
                        Display="None" meta:resourcekey="rfvIssueDate" SetFocusOnError="True" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
--%>
                    <td align="left">
                        <My:CalendarTextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate") %>' />
                        <%--                    <asp:TextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate","{0:yyyy/MM/dd}") %>' MaxLength="50"></asp:TextBox><ajaxToolkit:CalendarExtender ID="ceIssueDate" runat="server" TargetControlID="txtIssueDate"
                        Format="yyyy/MM/dd">
                    </ajaxToolkit:CalendarExtender>
<asp:CompareValidator meta:resourcekey="cvIssueDate" ID="cvIssueDate" runat="server" ControlToValidate="txtIssueDate" Display="None"
                        Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vInsert"></asp:CompareValidator>
--%>
                    </td>
            </tr>
            <tr>
                <td align="right">
                </td>
                <td align="left">
                    <asp:Button ID="btnAdd" runat="server" meta:resourcekey="btnAdd" CommandName="btnSave"
                        ValidationGroup="vInsert" />
                </td>
            </tr>
        </table>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vInsert" />
    </InsertItemTemplate>
    <EditItemTemplate>
        <table>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVolunteerName" runat="server" meta:resourcekey="lblVolunteerName"></asp:Label>
                </td>
                <td align="left">
                    <asp:Label ID="lblVolunteerNameText" runat="server" Text='<%# Bind("VolunteerName") %>'></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVBookID" runat="server" meta:resourcekey="lblVBookID"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSerialNumber"
                        Display="None" meta:resourcekey="rfvSerialNumber" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
                <td align="left">
                    <asp:DropDownList ID="ddlCountyID" runat="server">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlSerialGroup" runat="server">
                    </asp:DropDownList>
                    <%--<asp:CompareValidator ID="vadSerialNumber" runat="server" ControlToValidate="txtSerialNumber" ValueToCompare="000000" Operator="GreaterThanEqual" Type="String" Display="None" meta:resourcekey="rfvSerialNumber"></asp:CompareValidator>--%>
<%--                    <My:StringLengthValidator ID="vadSerialNumber" ControlToValidate="txtSerialNumber"
                        runat="server" Length="6" Display="None" meta:resourcekey="rfvSerialNumber2"
                        ValidationGroup="vInsert" />--%>
                    <asp:Label ID="lblSerialGroup" runat="server" meta:resourcekey="lblSerialGroup"></asp:Label>
                    <asp:TextBox ID="txtSerialNumber" runat="server" MaxLength="10" Text='<%# Bind("SerialNumber") %>'></asp:TextBox>
                    <asp:Label ID="lblSerialNumber" runat="server" meta:resourcekey="lblSerialNumber"></asp:Label></td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblStatePaperID" runat="server" meta:resourcekey="lblStatePaperID"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtStatePaperID" runat="server" MaxLength="10" Text='<%# Bind("StatePaperID") %>'></asp:TextBox>
<%--                    <asp:RequiredFieldValidator ID="vadStatePaperID1" runat="server" ControlToValidate="txtStatePaperID"
                        Display="None" meta:resourcekey="vadStatePaperID" ValidationGroup="vInsert"></asp:RequiredFieldValidator>--%>
                    <%--                    <My:StringLengthValidator ID="vadStatePaperID2" ControlToValidate="txtStatePaperID"
                        runat="server" Length="9" Display="None" meta:resourcekey="vadStatePaperID"
                        ValidationGroup="vInsert" />--%></td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblIssueDate" runat="server" meta:resourcekey="lblIssueDate"></asp:Label>
                    <%--                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtIssueDate"
                        Display="None" meta:resourcekey="rfvIssueDate" SetFocusOnError="True" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
--%>
                    <td align="left">
                        <My:CalendarTextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate") %>' />
                        <%--                    <asp:TextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate","{0:yyyy/MM/dd}") %>' MaxLength="50"></asp:TextBox><ajaxToolkit:CalendarExtender ID="ceIssueDate" runat="server" TargetControlID="txtIssueDate"
                        Format="yyyy/MM/dd">
                    </ajaxToolkit:CalendarExtender>
<asp:CompareValidator meta:resourcekey="cvIssueDate" ID="cvIssueDate" runat="server" ControlToValidate="txtIssueDate" Display="None"
                        Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vInsert"></asp:CompareValidator>
--%>
                    </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:RadioButtonList ID="rdoEditMode" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rdoEditMode_SelectedIndexChanged" AutoPostBack="true">
                        <asp:ListItem meta:resourcekey="btnEdit" Value="MyEdit" Selected="True"></asp:ListItem>
                        <asp:ListItem meta:resourcekey="btnReIssue" Value="ReIssue"></asp:ListItem>
                    </asp:RadioButtonList>
<%--                    <asp:Button ID="btnEdit" runat="server" meta:resourcekey="btnEdit" CommandName="MyEdit" />
                    <asp:Button ID="btnReIssue" runat="server" meta:resourcekey="btnReIssue" CommandName="ReIssue" />--%>
                </td>
            </tr>
            <asp:PlaceHolder ID="plSave" runat="server" Visible="true">
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">
                        <asp:Label ID="lblComment" runat="server" meta:resourcekey="lblComment"></asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Rows="4" Text='<%# Bind("Comment") %>' MaxLength="600" Width="250px"></asp:TextBox>                        　
                    </td>
                </tr>
                
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
                 <tr valign="top">
                    <td align="right">
                        <asp:Label ID="lblOldComment" runat="server" meta:resourcekey="lblOldComment" Visible="false"></asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtOldComment" runat="server" TextMode="MultiLine" Rows="4"  MaxLength="600" Width="250px" Visible="false"></asp:TextBox>                        　
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="btnAdd" runat="server" meta:resourcekey="btnAdd" CommandName="btnSave"
                            ValidationGroup="vInsert" />

                    </td>
                </tr>                                
            </asp:PlaceHolder>
        </table>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vInsert" />
    </EditItemTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVolunteerName" runat="server" meta:resourcekey="lblVolunteerName"></asp:Label>
                </td>
                <td align="left">
                    <asp:Label ID="lblVolunteerNameText" runat="server" Text='<%# Bind("VolunteerName") %>'></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblVBookID" runat="server" meta:resourcekey="lblVBookID"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSerialNumber"
                        Display="None" meta:resourcekey="rfvSerialNumber" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
                <td align="left">
                    <asp:DropDownList ID="ddlCountyID" runat="server">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlSerialGroup" runat="server">
                    </asp:DropDownList>
                    <%--<asp:CompareValidator ID="vadSerialNumber" runat="server" ControlToValidate="txtSerialNumber" ValueToCompare="000000" Operator="GreaterThanEqual" Type="String" Display="None" meta:resourcekey="rfvSerialNumber"></asp:CompareValidator>--%>
                <%--    <My:StringLengthValidator ID="vadSerialNumber" ControlToValidate="txtSerialNumber"
                        runat="server" Length="6" Display="None" meta:resourcekey="rfvSerialNumber2"
                        ValidationGroup="vInsert" />--%>
                    <asp:Label ID="lblSerialGroup" runat="server" meta:resourcekey="lblSerialGroup"></asp:Label>
                    <asp:TextBox ID="txtSerialNumber" runat="server" MaxLength="10" Text='<%# Bind("SerialNumber") %>'></asp:TextBox>
                    <asp:Label ID="lblSerialNumber" runat="server" meta:resourcekey="lblSerialNumber"></asp:Label></td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblStatePaperID" runat="server" meta:resourcekey="lblStatePaperID"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtStatePaperID" runat="server" MaxLength="10" Text='<%# Bind("StatePaperID") %>'></asp:TextBox>
<%--                    <asp:RequiredFieldValidator ID="vadStatePaperID1" runat="server" ControlToValidate="txtStatePaperID"
                        Display="None" meta:resourcekey="vadStatePaperID" ValidationGroup="vInsert"></asp:RequiredFieldValidator>--%>
<%--                    <My:StringLengthValidator ID="vadStatePaperID2" ControlToValidate="txtStatePaperID"
                        runat="server" Length="9" Display="None" meta:resourcekey="vadStatePaperID"
                        ValidationGroup="vInsert" />--%>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblIssueDate" runat="server" meta:resourcekey="lblIssueDate"></asp:Label>
                    <%--                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtIssueDate"
                        Display="None" meta:resourcekey="rfvIssueDate" SetFocusOnError="True" ValidationGroup="vInsert"></asp:RequiredFieldValidator></td>
--%>
                    <td align="left">
                        <My:CalendarTextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate") %>' />
                        <%--                    <asp:TextBox ID="txtIssueDate" runat="server" Text='<%#Bind("IssueDate","{0:yyyy/MM/dd}") %>' MaxLength="50"></asp:TextBox><ajaxToolkit:CalendarExtender ID="ceIssueDate" runat="server" TargetControlID="txtIssueDate"
                        Format="yyyy/MM/dd">
                    </ajaxToolkit:CalendarExtender>
<asp:CompareValidator meta:resourcekey="cvIssueDate" ID="cvIssueDate" runat="server" ControlToValidate="txtIssueDate" Display="None"
                        Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vInsert"></asp:CompareValidator>
--%>
                    </td>
            </tr>
            <asp:PlaceHolder ID="plSave" runat="server" Visible="true">
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">
                        <asp:Label ID="lblComment" runat="server" meta:resourcekey="lblComment"></asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Rows="4" Text='<%# Bind("Comment") %>'></asp:TextBox>                        　
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
            </asp:PlaceHolder>
        </table>
    </ItemTemplate>
    
</My:MyFormView>
